package net.yondervision.hrfsp.sdk.esign.domain.request;

import cn.hutool.http.Method;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.yondervision.hrfsp.sdk.esign.domain.AbstractESignRequest;
import net.yondervision.hrfsp.sdk.esign.domain.ESignRequest;
import net.yondervision.hrfsp.sdk.esign.domain.request.query.AccessTokenParamQuery;
import net.yondervision.hrfsp.sdk.esign.domain.response.AccessTokenResponse;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/09/26 22:03
 */
@Data
@Builder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class AccessTokenRequest
    extends AbstractESignRequest implements ESignRequest<AccessTokenResponse> {

  private AccessTokenParamQuery accessTokenParamQuery;

  public AccessTokenRequest(AccessTokenParamQuery accessTokenParamQuery) {
    this.accessTokenParamQuery = accessTokenParamQuery;
    this.setParamQuery(accessTokenParamQuery);
  }


  @Override
  public String getUrl() {
    return "/oauth2/access_token";
  }

  @Override
  public Method getMethodType() {
    return Method.GET;
  }

  @Override
  public Class<AccessTokenResponse> getResponseClass() {
    return AccessTokenResponse.class;
  }

}

